<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <div id="app"></div>
    <template id="t1">
      <div>
        <input
          @input="from.username = $event.target.value"
          type="text"
          :value="form.username"
        />
        <hr />
        <!-- 语法糖 -->
        <input v-model="form.username" />
        {{form.username}}
      </div>
    </template>
    <script src="./vue.js"></script>
    <script>
      new Vue({
        el: "#app",
        template: "#t1",
        data: {
          form: {
            username: "jack",
          },
        },
        methods: {
          hi(e) {
            console.log(e);
          },
        },
      });
    </script>
  </body>
</html>
